import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const router = new VueRouter({
    mode: 'history',
    linkActiveClass: 'mui-active',
    routes: [
        {
            path: '/home',
            name: 'Home',
            component: () => import('../pages/tabbar/Home.vue')
        },
        {
            path: '/member',
            name: 'Member',
            component: () => import('../pages/tabbar/Member.vue')
        },
        {
            path: '/shopcart',
            name: 'ShopCart',
            component: () => import('../pages/tabbar/ShopCart.vue')
        },
        {
            path: '/search',
            name: 'Search',
            component: () => import('../pages/tabbar/Search.vue')
        },
        {
            path: '/home/newslist',
            name: 'NewsList',
            component: () => import('../pages/news/NewsList.vue')
        },
        {
            path: '/home/newsinfo/:type/:id',
            name: 'NewsInfo',
            component: () => import('../pages/news/NewsInfo.vue')
        },
        {
            path: '/home/photolist',
            name: 'PhotoList',
            component: () => import('../pages/photos/PhotoList.vue')
        },
        {
            path: '/home/photoinfo/:id',
            name: 'PhotoInfo',
            component: () => import('../pages/photos/PhotoInfo.vue')
        },
        {
            path: '/home/goodslist',
            name: 'GoodsList',
            component: () => import('../pages/goods/GoodsList.vue')
        },
        {
            path: '/home/goodsinfo/:id',
            name: 'GoodsInfo',
            component: () => import('../pages/goods/GoodsInfo.vue')
        },
        {
            path: '/',
            redirect: '/home'
        },
    ]
});

export default router;